
<%- include('./layouts/admin_head',{title:'Add new post'});%>
<body>
  <script>NProgress.start()</script>

  <div class="main">
    <%- include('./layouts/admin_navbar');%>
    <div class="container-fluid">
      <div class="page-title">
        <h1>写文章</h1>
      </div>
      <!-- 有错误信息时展示 -->
      <!-- <div class="alert alert-danger">
        <strong>错误！</strong>发生XXX错误
      </div> -->
      <form class="row" id="form">
        <div class="col-md-9">
          <div class="form-group">
            <label for="title">标题</label>
            <input id="title" class="form-control input-lg" name="title" type="text" placeholder="文章标题">
          </div>
          <div class="form-group">
            <label for="content">标题</label>
            <textarea id="content" class="form-control input-lg" name="content" cols="30" rows="10" placeholder="内容"></textarea>
          </div>
        </div>
        <div class="col-md-3">
          <div class="form-group">
            <label for="slug">别名</label>
            <input id="slug" class="form-control" name="slug" type="text" placeholder="slug">
            <p class="help-block">https://zce.me/post/<strong>slug</strong></p>
          </div>
          <div class="form-group">
            <label for="feature">特色图像</label>
            <!-- show when image chose -->
            <img class="help-block thumbnail" style="display: none">
            <input id="feature" class="form-control"  type="file">
            <input type="hidden" name="feature" id="img">
          </div>
          <div class="form-group">
            <label for="category">所属分类</label>
            <select id="category" class="form-control" name="category_id">
              <!-- <option value="1">未分类</option>
              <option value="2">潮生活</option> -->
            </select>
          </div>
          <div class="form-group">
            <label for="created">发布时间</label>
            <input id="created" class="form-control" name="created" type="datetime-local">
          </div>
          <div class="form-group">
            <label for="status">状态</label>
            <select id="status" class="form-control" name="status">
              <option value="drafted">草稿</option>
              <option value="published">已发布</option>
              <option value="trashed">已作废</option>
            </select>
          </div>
          <div class="form-group">
            <input type="button" id="subBtn" class="btn btn-primary" value="保存">
          </div>
        </div>
      </form>
    </div>
  </div>

  <%- include('./layouts/admin_aside.ejs');%>
  <%- include('./layouts/admin_footer');%>
  <script src="/assets/vendors/ckeditor/ckeditor.js"></script>
  <script src="/assets/js/utils.js"></script>
  <script src="/assets/js/postAdd.js"></script>
